<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Aestate: aestate/work/commad.py Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aestate
   &#160;<span id="projectnumber">1.0.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_374ee6e3281d8312d956f1f155302869.html">aestate</a></li><li class="navelem"><a class="el" href="dir_5abfa80149f37441c1f61fb6211d8f7d.html">work</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">commad.py</div>  </div>
</div><!--header-->
<div class="contents">
<a href="commad_8py.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html">    1</a></span>&#160;<span class="comment"># -*- utf-8 -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"># encoding:utf-8</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"># @Time: 2021/6/27 20:47</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"># @Author: CACode</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"># 版本有三种状态 正式版从1.0.0往后逐个加 1,对应版本的补丁为&#39;a+补丁次数&#39;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#a4655682f942716dbe3fbfaebf644db62">    6</a></span>&#160;__version__ = <span class="stringliteral">&#39;1.0.5&#39;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#ab32ee66ae9adffe6b28bd2cfeb498c77">    7</a></span>&#160;__description__ = <span class="stringliteral">&quot;Aestate framework for Python,You can see:https://gitee.com/aecode/aestate&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#a929fa0ec1fbd6adfac9502a2d41d8bfb">    8</a></span>&#160;__author__ = <span class="stringliteral">&quot;CACode&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#ab74890ee6de206cce2e11155084d7363">    9</a></span>&#160;__author_email__ = <span class="stringliteral">&quot;cacode@163.com&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#aa8c2cc51cb61bc99e82567b87b894c49">   10</a></span>&#160;__url__ = <span class="stringliteral">&quot;https://gitee.com/aecode/aestate&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#a83167bd07100de1f8bd6499c7f40833b">   11</a></span>&#160;__issues__ = <span class="stringliteral">&#39;https://gitee.com/aecode/aestate/issues&#39;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#aa7ec9c3971751c9e5e7847cbe4899542">   12</a></span>&#160;__license__ = <span class="stringliteral">&#39;Apache License 2.0&#39;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#aff494de45cc22937c995dfbe96e0fc95">   13</a></span>&#160;__project_name__ = <span class="stringliteral">&#39;Aestate&#39;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#a62cd05b3624902f1a18e59add9a257a8">   14</a></span>&#160;__logo__ = <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="stringliteral">         :: Aestate Framework ::      (version:%s)</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="stringliteral">    +    __                    _        _        __    +</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="stringliteral">    +   / /     /\            | |      | |       \ \   +</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="stringliteral">    +  / /     /  \   ___  ___| |_ __ _| |_ ___   \ \  +</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="stringliteral">    + | |     / /\ \ / _ \/ __| __/ _` | __/ _ \   | | +</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="stringliteral">    +  \ \   / ____ \  __/\__ \ || (_| | ||  __/  / /  +</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="stringliteral">========\_\=/_/====\_\___||___/\__\__,_|\__\___|=/_/========</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="stringliteral">&quot;&quot;&quot;</span> % __version__</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1commad.html#a5f67bfe3950cd7e59cd59c876cab1eed">   24</a></span>&#160;__log_logo__ = <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="stringliteral">         :: Aestate Framework ::      (version:%s)</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="stringliteral">       __      ____    ___    ____      __      ____    ____ </span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="stringliteral">      /__\    ( ___)  / __)  (_  _)    /__\    (_  _)  ( ___)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="stringliteral">     /(__)\    )__)   \__ \    )(     /(__)\     )(     )__) </span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="stringliteral">    (__)(__)  (____)  (___/   (__)   (__)(__)   (__)   (____)</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="stringliteral">&quot;&quot;&quot;</span> % __version__</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">import</span> importlib</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keywordflow">try</span>:</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keyword">from</span> prettytable <span class="keyword">import</span> PrettyTable</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keywordflow">except</span> ModuleNotFoundError <span class="keyword">as</span> e:</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    print(<span class="stringliteral">&quot;请先安装 [prettytable] 再执行 [-h] 命令,使用 [pip install prettytable]&quot;</span>)</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html">   40</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html">Commands</a>:</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#a7921e92ac1d787d007e823efe252b3a0">   41</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a7921e92ac1d787d007e823efe252b3a0">__init__</a>(self, *args):</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="stringliteral">        下面的@staticmethod主要是为了不想看见黄线警告，并没有其他意思</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="stringliteral">        &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1dbef820627a3c97278e3fdf4951eedc">   45</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1dbef820627a3c97278e3fdf4951eedc">args</a> = args</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#afb187dd2a07d14f2067002caa7aef74b">   46</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#afb187dd2a07d14f2067002caa7aef74b">c</a> = {</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            <span class="stringliteral">&quot;&quot;</span>: (</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#acb9ede88828f4dfdfc182e01393b8bb0">start</a>,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;                <span class="stringliteral">&#39;显示aestate的logo和版本号，用于检查aestate是否安装成功&#39;</span>,</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                <span class="stringliteral">&quot;aestate&quot;</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            ),</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            <span class="stringliteral">&quot;-v&quot;</span>: (</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1b8703f06e2a8a00c8ffffea1e927ae2">version</a>,</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                <span class="stringliteral">&quot;显示aestate的版本号&quot;</span>,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                <span class="stringliteral">&quot;aestate -v&quot;</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            ),</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            <span class="stringliteral">&quot;-create&quot;</span>: (</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#acd7d01b00bd04f10e98fb9913cedc51c">create</a>,</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                <span class="stringliteral">&quot;将文件内存在pojo对象的类生成到数据库中称为数据库的表&quot;</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                <span class="stringliteral">&quot;数据库格式化类型参考默认的 [mysql] 格式&quot;</span>,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                <span class="stringliteral">&#39;aestate -create [文件名] [数据库类型 (可选)]&#39;</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            ),</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            <span class="stringliteral">&quot;-m&quot;</span>: (</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae50fc24fb46a2ba21f400cf39428e488">make</a>,</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                <span class="stringliteral">&quot;将数据库中的表同步生成到当前目录下的 [model.py]，并默认命名为 [数据库命_表名]&quot;</span>,</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                <span class="stringliteral">&#39;aestate -m [--n [生成的文件名 (可选) ]] [--nn [生成的类名 (可选)]]&#39;</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            ),</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            <span class="stringliteral">&quot;-enc&quot;</span>: (</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae54903cf0ae24143d97bd4d4ee4629a8">enc</a>,</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                <span class="stringliteral">&quot;加密模型&quot;</span>,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                <span class="stringliteral">&#39;aestate -enc [密码]&#39;</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            ),</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="stringliteral">&quot;-dec&quot;</span>: (</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#af56b5b82d52428a5005fe8089ca1fd95">dec</a>,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                <span class="stringliteral">&quot;解密模型&quot;</span>,</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                <span class="stringliteral">&#39;aestate -dec [被加密后的文件] [密码]&#39;</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            ),</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <span class="stringliteral">&quot;-check&quot;</span>: (</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a37094cb862b04a7b804b0c791fd01453">check</a>,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;                <span class="stringliteral">&quot;检查模型与数据库中的表结构是否一直&quot;</span>,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                <span class="stringliteral">&#39;aestate -check [文件名] [数据库名]&#39;</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            ),</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="stringliteral">&quot;-h&quot;</span>: (</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a5e48ff352a2ad555de711682e441dedd">help</a>,</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                <span class="stringliteral">&quot;帮助文档&quot;</span>,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                <span class="stringliteral">&#39;aestate -h&#39;</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;            ),</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="stringliteral">&quot;-startproject&quot;</span>: (</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#aed17bfc6b6ec58bda7e3f57b681a8ef4">startproject</a>,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                <span class="stringliteral">&quot;创建一个web项目&quot;</span>,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                <span class="stringliteral">&#39;aestate -startproject 项目名&#39;</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            )</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        }</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#aed17bfc6b6ec58bda7e3f57b681a8ef4">   95</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#aed17bfc6b6ec58bda7e3f57b681a8ef4">startproject</a>(self):</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#acb9ede88828f4dfdfc182e01393b8bb0">   98</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#acb9ede88828f4dfdfc182e01393b8bb0">start</a>(self):</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        print(__logo__)</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#acd7d01b00bd04f10e98fb9913cedc51c">  101</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#acd7d01b00bd04f10e98fb9913cedc51c">create</a>(self):</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        print(__logo__)</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="keywordflow">try</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            file = self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1dbef820627a3c97278e3fdf4951eedc">args</a>[2]</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            db_name = self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1dbef820627a3c97278e3fdf4951eedc">args</a>[3]</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">except</span> IndexError:</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">raise</span> IndexError(<span class="stringliteral">&quot;为了保证数据库的sql执行顺利，请填写pojo存在的文件名和数据库名称&quot;</span>)</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        <span class="keyword">import</span> inspect</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        temp_module = importlib.import_module(file)</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        temp_classes = inspect.getmembers(temp_module, inspect.isclass)</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">for</span> name, class_ <span class="keywordflow">in</span> temp_classes:</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            c = class_()</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            c.orm.create()</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae54903cf0ae24143d97bd4d4ee4629a8">  116</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae54903cf0ae24143d97bd4d4ee4629a8">enc</a>(self):</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#af56b5b82d52428a5005fe8089ca1fd95">  119</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#af56b5b82d52428a5005fe8089ca1fd95">dec</a>(self):</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1b8703f06e2a8a00c8ffffea1e927ae2">  122</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a1b8703f06e2a8a00c8ffffea1e927ae2">version</a>(self):</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        print(__version__)</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae50fc24fb46a2ba21f400cf39428e488">  125</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#ae50fc24fb46a2ba21f400cf39428e488">make</a>(self):</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#a37094cb862b04a7b804b0c791fd01453">  128</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a37094cb862b04a7b804b0c791fd01453">check</a>(self):</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        print(__logo__)</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="keywordflow">try</span>:</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            file = self.args[2]</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            db_name = self.args[3]</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <span class="keywordflow">except</span> IndexError:</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;            <span class="keywordflow">raise</span> IndexError(<span class="stringliteral">&quot;为了保证数据库的sql执行顺利，请填写pojo存在的文件名和数据库名称&quot;</span>)</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        <span class="keyword">import</span> inspect</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        temp_module = importlib.import_module(file)</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        temp_classes = inspect.getmembers(temp_module, inspect.isclass)</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keywordflow">for</span> name, class_ <span class="keywordflow">in</span> temp_classes:</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            c = class_()</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            c.orm.check()</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1commad_1_1_commands.html#a5e48ff352a2ad555de711682e441dedd">  143</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#a5e48ff352a2ad555de711682e441dedd">help</a>(self):</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        table = PrettyTable([<span class="stringliteral">&quot;命令&quot;</span>, <span class="stringliteral">&quot;使用方法&quot;</span>, <span class="stringliteral">&quot;描述&quot;</span>])</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        table.border = <span class="keyword">True</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        table.junction_char = <span class="stringliteral">&#39;-&#39;</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        [table.add_row([k, v[2], v[1]]) <span class="keywordflow">for</span> k, v <span class="keywordflow">in</span> self.<a class="code" href="classaestate_1_1work_1_1commad_1_1_commands.html#afb187dd2a07d14f2067002caa7aef74b">c</a>.items()]</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        print(table)</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_a37094cb862b04a7b804b0c791fd01453"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#a37094cb862b04a7b804b0c791fd01453">aestate.work.commad.Commands.check</a></div><div class="ttdeci">def check(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00128">commad.py:128</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_a5e48ff352a2ad555de711682e441dedd"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#a5e48ff352a2ad555de711682e441dedd">aestate.work.commad.Commands.help</a></div><div class="ttdeci">def help(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00143">commad.py:143</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_a1dbef820627a3c97278e3fdf4951eedc"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#a1dbef820627a3c97278e3fdf4951eedc">aestate.work.commad.Commands.args</a></div><div class="ttdeci">args</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00045">commad.py:45</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_ae54903cf0ae24143d97bd4d4ee4629a8"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#ae54903cf0ae24143d97bd4d4ee4629a8">aestate.work.commad.Commands.enc</a></div><div class="ttdeci">def enc(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00116">commad.py:116</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_afb187dd2a07d14f2067002caa7aef74b"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#afb187dd2a07d14f2067002caa7aef74b">aestate.work.commad.Commands.c</a></div><div class="ttdeci">c</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00046">commad.py:46</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_a1b8703f06e2a8a00c8ffffea1e927ae2"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#a1b8703f06e2a8a00c8ffffea1e927ae2">aestate.work.commad.Commands.version</a></div><div class="ttdeci">def version(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00122">commad.py:122</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_a7921e92ac1d787d007e823efe252b3a0"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#a7921e92ac1d787d007e823efe252b3a0">aestate.work.commad.Commands.__init__</a></div><div class="ttdeci">def __init__(self, *args)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00041">commad.py:41</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_acb9ede88828f4dfdfc182e01393b8bb0"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#acb9ede88828f4dfdfc182e01393b8bb0">aestate.work.commad.Commands.start</a></div><div class="ttdeci">def start(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00098">commad.py:98</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html">aestate.work.commad.Commands</a></div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00040">commad.py:40</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_ae50fc24fb46a2ba21f400cf39428e488"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#ae50fc24fb46a2ba21f400cf39428e488">aestate.work.commad.Commands.make</a></div><div class="ttdeci">def make(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00125">commad.py:125</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_af56b5b82d52428a5005fe8089ca1fd95"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#af56b5b82d52428a5005fe8089ca1fd95">aestate.work.commad.Commands.dec</a></div><div class="ttdeci">def dec(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00119">commad.py:119</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_acd7d01b00bd04f10e98fb9913cedc51c"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#acd7d01b00bd04f10e98fb9913cedc51c">aestate.work.commad.Commands.create</a></div><div class="ttdeci">def create(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00101">commad.py:101</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1commad_1_1_commands_html_aed17bfc6b6ec58bda7e3f57b681a8ef4"><div class="ttname"><a href="classaestate_1_1work_1_1commad_1_1_commands.html#aed17bfc6b6ec58bda7e3f57b681a8ef4">aestate.work.commad.Commands.startproject</a></div><div class="ttdeci">def startproject(self)</div><div class="ttdef"><b>Definition:</b> <a href="commad_8py_source.html#l00095">commad.py:95</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
